<!--
 * @Author: hu_binbin
 * @Date: 2021-08-19 10:27:02
 * @LastEditTime: 2021-08-21 16:44:30
 * @Description: 信息查询-巡视任务筛选
-->

<template>
    <div class="bg_4dbfae">
        <div class="password-input">
            <van-password-input
                :value="password"
                :error-info="errorInfo"
                :focused="showKeyboard"
                @focus="showKeyboard = true"
            />
        </div>
        <van-number-keyboard
            v-model="password"
            :show="showKeyboard"
            @blur="showKeyboard = false"
        />
    </div>
</template>

<script>
export default {
    name:"password",
    props: {
    },
    data() {
        return {
            password: '',
            errorInfo: '',
            showKeyboard: true,
        }
    },
    watch: {
        password(value) {
            if (value.length === 6) {
                if(value !== '123456') {
                    this.errorInfo = '密码输入错误！';
                }else{
                    this.errorInfo = '';
                    this.password = "";
                    this.$Toast("签名成功")
                    this.$emit("closePassword")
                }
            } else {
                this.errorInfo = '';
            }
        },
    },
    methods: {

    },
};
</script>

<style scoped>
    .title{
        text-align: center;
        margin: 1rem 0.5rem;
        font-size: 15px;
        color: #333;
    }
    .bg_4dbfae{
		background: #F5F6F7 ;
        width: 100%;
        height: 100%;
	}
    .password-input{
        padding-top: 18%;
    }
</style>